import axios from 'axios'

export const ApplyProgressPaymentService = class ApplyProgressPaymentService {
    static applyProgressPaymentService = null
    requestUrl = 'http://localhost/apply'

    static getInstance(){
        if(this.applyProgressPaymentService == null){
            this.applyProgressPaymentService = new ApplyProgressPaymentService()
        }
        return this.applyProgressPaymentService
    }

    // 获取最大的id
    getMaxId(){
        return axios.get(`${this.requestUrl}/getMaxId`)
    }

    // 保存的方法
    save(applyForm, applyDetails){
        const params = { applyForm, applyDetails }
        return axios.post(this.requestUrl, params)
    }
    
    // 获取所有的数据
    getList(params){
        return axios.get(this.requestUrl, {params})
    }
    // 用id获取单个数据
    selectOne(params){
        return axios.get(`${this.requestUrl}/${params}`)
    }
    // 进度款申报查询
    progressQuery(params){
        return axios.get(`${this.requestUrl}/query`, {params})
    }
}